/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package simulator;

import com.bulletphysics.collision.broadphase.DbvtBroadphase;
import com.bulletphysics.collision.dispatch.CollisionDispatcher;
import com.bulletphysics.collision.dispatch.DefaultCollisionConfiguration;
import com.bulletphysics.dynamics.DiscreteDynamicsWorld;
import com.bulletphysics.dynamics.constraintsolver.SequentialImpulseConstraintSolver;
import javax.vecmath.Vector3f;

/**
 *
 * @author vdelaitr
 */
public class WorldJBullet extends World {
    
    // Dynamic world instance
    DiscreteDynamicsWorld world;

    WorldJBullet(String file) throws WorldException {
        super(file);

        DefaultCollisionConfiguration cc = new DefaultCollisionConfiguration();
        CollisionDispatcher cd = new CollisionDispatcher(cc);
        DbvtBroadphase bp = new DbvtBroadphase();
        SequentialImpulseConstraintSolver sics = new SequentialImpulseConstraintSolver();

        world = new DiscreteDynamicsWorld(cd, bp, sics, cc);
        world.setGravity(new Vector3f(0.f, -9.8f, 0.f));
    }
}
